package com.huanletao.quartz.entity;


import com.huanletao.quartz.execute.AbstractExecuteJobQuartz;
import org.apache.commons.lang.builder.ToStringBuilder;

import java.util.StringJoiner;

/**
 * <p>
 *
 * </p>
 *
 * @package: com.huanletao.quartz
 * @description:
 * @className: Job
 * @author: @踏雪无痕
 * @date: Created in 2022/5/31
 * @copyright: Copyright (c) 2022/5/31
 * @version: V1.0
 */
public class JobDetails {
    private Long id;
    private String jobName;
    private String groupName;
    private String cron;
    private String targetName;
    private String status;
    private int misfirePolicy;
    private Class<? extends AbstractExecuteJobQuartz> executeJobClass;

    public JobDetails(String jobName, String groupName, String cron, String targetName, String status) {
        this.jobName = jobName;
        this.groupName = groupName;
        this.cron = cron;
        this.targetName = targetName;
        this.status = status;
    }

    public JobDetails() {
    }

    public int getMisfirePolicy() {
        return misfirePolicy;
    }

    public void setMisfirePolicy(int misfirePolicy) {
        this.misfirePolicy = misfirePolicy;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Class<? extends AbstractExecuteJobQuartz> getExecuteJobClass() {
        return executeJobClass;
    }

    public void setExecuteJobClass(Class<? extends AbstractExecuteJobQuartz> executeJobClass) {
        this.executeJobClass = executeJobClass;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getTargetName() {
        return targetName;
    }

    public void setTargetName(String targetName) {
        this.targetName = targetName;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public String getCron() {
        return cron;
    }

    public void setCron(String cron) {
        this.cron = cron;
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", id)
                .append("jobName", jobName)
                .append("groupName", groupName)
                .append("cron", cron)
                .append("targetName", targetName)
                .append("status", status)
                .append("misfirePolicy", misfirePolicy)
                .toString();
    }
}
